package com.ygqh.baby.mapper;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.model.YgHotProductModel;
import com.ygqh.baby.po.BiSkuSale;
import com.ygqh.baby.po.BiSkuSaleExample;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface BiSkuSaleMapper {
    int countByExample(BiSkuSaleExample example);

    int deleteByExample(BiSkuSaleExample example);

    int deleteByPrimaryKey(Long id);

    int insert(BiSkuSale record);

    int insertSelective(BiSkuSale record);

    List<BiSkuSale> selectByExample(BiSkuSaleExample example);

    BiSkuSale selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") BiSkuSale record, @Param("example") BiSkuSaleExample example);

    int updateByExample(@Param("record") BiSkuSale record, @Param("example") BiSkuSaleExample example);

    int updateByPrimaryKeySelective(BiSkuSale record);

    int updateByPrimaryKey(BiSkuSale record);

    int countSuper(@Param("q") String q);

    List<BiSkuSale> selectSuper(@Param("queryInfo") QueryInfo queryInfo, @Param("q") String q);

    int addBatch(@Param("list") List<BiSkuSale> list);

    List<BiSkuSale> selectBiSkuSaleList(@Param("queryInfo") QueryInfo queryInfo, @Param("startDate") Date startDate,
                                        @Param("endDate") Date endDate, @Param("shopNo") String shopNo, @Param("shopName") String shopName,
                                        @Param("productCode") String productCode, @Param("productName") String productName,
                                        @Param("salesStartDate") Date salesStartDate, @Param("salesEndDate") Date salesEndDate);

    int countBiSkuSaleList(@Param("startDate") Date startDate, @Param("endDate") Date endDate,
                           @Param("shopNo") String shopNo, @Param("shopName") String shopName,
                           @Param("productCode") String productCode, @Param("productName") String productName,
                           @Param("salesStartDate") Date salesStartDate, @Param("salesEndDate") Date salesEndDate);

    List<BiSkuSale> selectBiProductSaleList(@Param("queryInfo") QueryInfo queryInfo,
                                            @Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("shopNo") String shopNo,
                                            @Param("shopName") String shopName, @Param("productCode") String productCode,
                                            @Param("productName") String productName, @Param("salesStartDate") Date salesStartDate,
                                            @Param("salesEndDate") Date salesEndDate);

    int countBiProductSaleList(@Param("startDate") Date startDate, @Param("endDate") Date endDate,
                               @Param("shopNo") String shopNo, @Param("shopName") String shopName,
                               @Param("productCode") String productCode, @Param("productName") String productName,
                               @Param("salesStartDate") Date salesStartDate, @Param("salesEndDate") Date salesEndDate);

    List<BiSkuSale> selectBiProductByShop(@Param("startDate") Date startDate, @Param("endDate") Date endDate,
                                          @Param("shopNo") String shopNo, @Param("productCode") String productCode);

    List<BiSkuSale> selectBiProductBySku(@Param("startDate") Date startDate, @Param("endDate") Date endDate,
                                         @Param("productCodes") String... productCodes);

    List<BiSkuSale> selectBiSkuSaleListByDate(@Param("queryInfo") QueryInfo queryInfo,
                                              @Param("productName") String productName, @Param("shopNo") String shopNo);

    int countBiSkuSaleListByDate(@Param("productName") String productName, @Param("shopNo") String shopNo);

    List<BiSkuSale> selectBiProductByShopCurr(@Param("productCode") String productCode, @Param("shopNo") String shopNo);

    List<BiSkuSale> selectBiProductBySkuCurr(@Param("shopNo") String shopNo,
                                             @Param("productCodes") String... productCode);

    List<BiSkuSale> statisticalSkuSaleCountOnlyM(@Param("queryInfo") QueryInfo queryInfo,
                                                 @Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("productCode") String productCode);

    List<BiSkuSale> selectSkuSaleList(@Param("biDate") Date biDate, @Param("shopName") String shopName);

    int updateAmountBatch(@Param("list") List<BiSkuSale> list);

    int additionAmountBatch(@Param("list") List<BiSkuSale> list);

    Boolean existed(@Param("shopNo") String shopNo, @Param("skuCode") String skuCode, @Param("biDate") Date biDate);

    int countHotProduct(@Param("queryInfo") QueryInfo queryInfo, @Param("startDate") Date startDate, @Param("endDate") Date endDate,
                        @Param("shopNo") String shopNo, @Param("shopName") String shopName, @Param("productName") String productName);

    List<YgHotProductModel> selectHotProductList(@Param("queryInfo") QueryInfo queryInfo, @Param("startDate") Date startDate,
                                                 @Param("endDate") Date endDate, @Param("shopNo") String shopNo, @Param("shopName") String shopName,
                                                 @Param("productName") String productName);
}
